package com.iretailer.report.quartz.init;

import com.iretailer.report.quartz.model.QuartzJobBean;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @Auther: xjw
 * @Date: 2019/1/23 14:27
 * @Description:
 */
public class QuartzJobFactoryDisallowConcurrentExecution implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        QuartzJobBean scheduleJob = (QuartzJobBean) context.getMergedJobDataMap().get("scheduleJob");
        try {
            QuartTaskUtil.invokMethod(scheduleJob);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
